<?php

class SearchController extends Core_Controller_BaseController
{

    public function indexAction()
    {
		$this->view->searchResult = array();
		 
		$searchForm = new Application_Form_Search();
		if ( $this->_request->isPost() ) {
			 if ( $searchForm->isValid( $this->_getAllParams() ) ) {
				 
				 $searchStr = $searchForm->getValue('search_text');
				 
				 $tableCatalog = new Application_Model_Catalog();
				 $this->view->searchResult = $tableCatalog->contextSearch( $searchStr );
				 
			//echo '<xmp>'.print_r($searchResult, 1).'</xmp>'; exit;
			 }
		}
    }

}

